package com.darren.cloud.archive.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class ApplicationController {


    @Value("${user.name1}")
    private String userName;


    @Value("${user.password}")
    private String userPassword;

    @Value("${user.age:10}")
    private Integer userAge;

    @Value("${user.email}")
    private String userEmail;

    @GetMapping("/hello")
    public String hello() {
        return String.format("User Name: %s; Password: %s; Email: %s; Age: %d.", userName, userPassword, userEmail, userAge);
    }

}
